#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
void charupaixu(int* a, int x)
{
	for (int i = 0; i < x - 1; i++)
	{
		int end =i;
		int tmp = a[end + 1];
		while (end >= 0)
		{
			if (a[end] > tmp)
			{
				a[end+1] = a[end];
				end--;
			}
			else{
				break;
			}
		}
		a[end + 1] = tmp;
	}
}
int main()
{
	int arr[] = { 2,4,89,23,987,123,5678,13,76,67,6666};
	charupaixu(arr, sizeof(arr) / sizeof(arr[0]));
	for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}